<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>
<body>
    <div id="app">
        <div>{{str}}</div>
        <button @click="reverseWorld">逆转世界</button>
    </div>
    <script>
        const app = new Vue({
            el:'#app',
            data:{
                str:'Hello,World'
            },
            methods:{
                reverseWorld() {
                    console.log(this.str);
                    
                    this.str = this.str.split('').reverse().join('')
                    console.log(this.str);
                }
            }
        })
    </script>
</body>
</html>